package com.example.mapper.medical;

import com.example.model.dto.DoctorDto;
import com.example.model.entity.medical.Doctor;
import com.example.model.entity.other.Account;
import com.example.model.vo.DoctorVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

/**
 * 操作Doctor相关数据接口
*/
public interface DoctorMapper {

    /**
      * 新增
    */
    int insert(Doctor Doctor);

    /**
      * 删除
    */
    int deleteById(Integer id);

    /**
      * 修改
    */
    int updateById(Doctor Doctor);

    /**
      * 根据ID查询
    */
    Doctor selectById(Integer id);

    /**
      * 查询所有
    */
    List<Doctor> selectAll(Doctor Doctor);

    @Select("select * from doctor where username = #{username}")
    Doctor selectByUsername(String username);
    @Select("select * from doctor where hospitalId = #{hospitalId}")
    List<Doctor> selectByHospitalId(Integer id);

    @Select("SELECT SUM(count) FROM doctor WHERE hospitalId = #{hospitalId}")
    Integer selectCountByHospitalId(int hospitalId);
    List<Doctor> selectTopDoctor();
    @Select("select * from doctor where hospitalId = #{hospitalId} and status='正常'")
    List<Doctor> selectByInfo(String hospitalId);

    List<Doctor> selectByOfficeId(Integer officeId);


    List<DoctorVo> selectFrontAll(Doctor doctor);
}
